NYSED A-Series Web Server notes (Release 2.1A BETA) March 9, 2006 As you already know this server software is not officially supported. We would still like to hear from you about problems getting the server up or bugs that you may run into at your site. I hope that this server allows you to meet the needs of your users. It is our attempt to return to the Internet community a part of what we have received from it. Eric Jackson PREREQUISITES: A. You are running COMS B. You are running Unisys TCP/IP C. MCP 4.1.2 and above (prior may experience non-fatal system dumps) D. Familiarity with the APACHE httpd server (formerly NCSA) or access to a copy of O'Reilly & Assoc.'s book "Managing Internet Information Services" (by Liu, Peek, Jones, Buus & Nye) would be helpful. UPGRADING FROM A PREVIOUS RELEASE: This release *REQUIRES* version 2.0B (or higher) of the CGI Library. There are changes to WWWSERV/CONFIG options so update the file accordingly. There may be new WWWSERV/ACCESS/CONFIG options so same as above. See enhancements listed below. INSTALLATION: 1. Create the source file on the A-Series. The source code is written in DCALGOL so make sure that the file type is DCALGOL. The file name is normally WWWSERV/SOURCE. You probably want to run it under a privileged usercode if it will be accessing files under multiple usercodes. 2. Compile it. The normal name is WWWSERV/EXE. It should only have two nodes in the file name. For example, do not use the name WWW/SERV/EXE. The reason is that it picks out the first node of its own name to locate the configuration files and create the log files. The first node of the file name may be anything you wish. Just remember to name the config files accordingly. 3. Create the configuration files. Currently the configuration files are all of type ALGOL. This may be changed in the future because of the limiting record size. The following is a list of configuration files used. WWWSERV/CONFIG *Required* WWWSERV/MIME/TYPES *Required* WWWSERV/ACCESS/CONFIG *Optional* WWWSERV/COMS/CONFIG *Required for CGI Applications* Samples of these config files are at the end of this document. 4. Configure COMS utility. Add a new program to COMS Utility. The following fields are needed: Program Name . . . . . . . . WWWSERVPG TITLE . . . . . . . . . . . WWWSERV/EXE USERCODE . . . . . . . . . . Database Name NONE Minimum Copies 1 Maximum Copies . . . . . . . 1 Remote-File Interface (Y/N) N Add the program attributes: Program Name . . . . . . . . WWWSERVPG Program Attributes Task Equation . . . . . . . PRIORITY = ; FAMILY DISK = ; OPTIONS = ; Add a new window to COMS Utility if desired: Window Name. . . . . . . . . . WWWSERV Window Type. . . . . . . . . . D (D - Direct R - Remote-File M - MCS) Add a new agenda to COMS Utility: Agenda Name . . . . . . . . . WWWSERVINAG Window Name WWWSERV Transaction-Mode Agenda (Y/N) . N Processing Items: Processing-Item List . . . . NONE Destination WWWSERVPG 5. Test your server by creating a simple html document in CANDE. Log on using the server usercode and try the following. Make sure to precede HOME/HTML with the DocumentRoot you put into the WWWSERV/CONFIG file. MAKE /HOME/HTML DATA SEQ Hello World!

Welcome to the Web!

Yes, this is really coming from a UNISYS A-Series. SAVE Then point your web browser at your server. If the server is working then you should receive the html document that you just created. http:///home.html URLs -VS- FILENAMES: As you see above there is a translation between the external URL and the internal A-Series file name. Three things happen to the file part of the URL. The period is converted to a slash, DocumentRoot is added to the beginning, and it is converted to upper case because A-Series file names must be upper case. So the case in the URL does not matter as it is converted to upper case at the server anyway. ALIASES: To provide access to files under other usercodes use the Alias configuration option. The following alias in the WWWSERV/CONFIG configuration file: Alias /REGENTS/ (RGNTS)WWW/ allows a URL of: http:///regents/homepage.html to access the file: (RGNTS)WWW/HOMEPAGE/HTML FILE TYPES: Creating html documents in CANDE results in what I call NATIVE files. They contain EBCDIC characters and the server translates them to ASCII as they are sent to the web clients. BINARY files are also supported for all file types such as html, image, sound, etc. These may be FTPed to the A-Series in *binary* mode. The server detects these files and does not do any translation. Html documents created on PCs should be FTPed in *binary* mode to the A-Series. Also the Handshake file transfer process can be used to upload all file types from PCs. Again, use the *binary* transfer mode. ACCESS RESTRICTION: Access can be restricted to both files and applications by the WWWSERV/ACCESS/CONFIG file. There is a sample file below that shows the capabilities. In particular there is a new feature of the 'require user' option to allow USERDATA USERCODE/PASSWORD verification. The three possible configuration options include: (1) An ID and Password (*NOT* an A-SERIES USERCODE) specified in the ACCESS/CONFIG file: require user joe:secret (2) A *specific* A-SERIES USERCODE/Password: require user joe (1) *Any* valid A-SERIES USERCODE/Password: require user *NOTE that this version of the web server *requires* USERCODES for files (but not for CGI applications) in the 'Directory' fields of the ACCESS/CONFIG file. For Example: %under web server usercode *NOTE* that the Limit statement, i.e.: , does not check the request method specified. The Limit statement limits *all* request methods including GET, POST, and HEAD. BUILT-IN SERVER SIDE IMAGEMAP SUPPORT: Image maps are a method to allow "hot spots" on images that provide links to other pages or files. A-Series imagemaps use the NCSA imagemap syntax (not the CERN syntax). These should be created on a PC and uploaded in binary mode to the A-Series. Unlike the NCSA httpd web server, the NYSED-A-Series web server does not require an imagemap/config file. The server gets the full imagemap file names from the URL rather than looking them up in a configuration file. Just precede the imagemap file's "URL" with the imagemap scriptalias. This should help make the web administrator's life a little easier. For example, if the following URL allows you to directly view the imagemap file... http:///admin/mymap.map Then add the imagemap ScriptAlias defined in the server's configuration file to create the hypertext reference where the imagemap should be used... BUILT-IN SERVER SIDE ROTATOR SUPPORT: A rotator allows for a "random" result. It is sometimes used to provide a random picture on an html page. It is put to good use on sites such as Yahoo for displaying their random advertisements. This is new as of Version 2.0P. A brief description of setting this up to display a random image: (1) Create a text file with one image URL per line. Entries can be commented out with a # character. A sample file with three images listed: -----cut here----- #THIS IS A COMMENT /demo/photo18.gif /demo/photo8.gif http://www.nysed.gov/photo5.gif -----cut here----- (2) Place the text file on the web server. Assuming the URL for the text file is www.nysed.gov/example/rotate.txt you can call it up with your web browser to view the file. (3) Place the following HTML "image" into an html document to implement the image rotator function. Random Image KNOWN PROBLEMS/LIMITATIONS: Currently the server can only access files on the same disk family as itself. Configuration files are currently of type ALGOL which places restrictions on how long configuration options can be (72 chars). A method to allow continuation from one line to the next or, a "stream" file type may be necessary in the future. The log files have a limit of one million records each. The server now has two new configuration options, BreakLog and BackLogs, to allow the server administrator to specify when log files are to be closed and new ones opened as well as how many log files to retain. ENHANCEMENT HISTORY: Version 2.1A BETA (3/9/06) Added RHost option (Redirect Host) to redirect all requests if desired. Pick up GMT time from the system if the Time Zone has been set. AuthName can be a quoted string now. RedirectPerm can be abbreviated to RP. Some internal code reorganized. 4XX Error logging reduced - log 404 Not Found errors only. Version 2.0P BETA (5/25/99) Basically much faster than previous versions. Added OPENQ and CLOSEQ queues for improving subport handling Fill in REMOTE_HOST with IP address if host name doesn't resolve Image Rotator code added. COMS/CONFIG now loaded into memory at initialization. Increased ABSMAXPROC define from 75 to 100. New config settings added: MaxSpareServers, MinSpareServers, MaxClients MaxClients config option (rather than ABSMAXPROC code define) now limits the number of Request Handlers that will run Deimplement TimeOut config option in favor of the InputTimeout config option Replaced the WWWREQ/0 stack with a port connection handler stack (WWWCONN) Split LOGLOCK into multiple locks for higher thruput Bug fix on seg array error at 35810000 Bug fix to send last record of native files. Added timeout intervals for PERIODIC_CLEANUP (5 mins) and COMS input (5 secs) to reduce CPU overhead Version 2.0F BETA (1/13/98) Now pass USERCODES as REMOTE_USER to CGI apps Version 2.0E BETA (12/22/97) Bug fix for HTTP/1.1 chunking on GET requests Version 2.0C BETA (12/12/97) CGILIB reworked, CGI_FORM split up (VERSION 2.0B) Allow KEEPALIVE for HTTP/1.0 clients if the CGI app provides a Content-Length Bug fix for HTTP/1.1 chunking Added procedure VERIFY_USER_PASS and option to verify against USERDATA file Allow three possible Userid options in ACCESS/CONFIG: User id:pass Server-ID/Server-Password User id Usercode(specific)/Userdata-Password User Usercode(any)/Userdata-Password Added DNSResolve config option to turn off DNS resolution Check file names for validity before checking residency Renamed HANDLE_FILE to HANDLE_FILE_GET Moved addition of DOCROOT into ALIAS_TYPE_USED procedure http:// test made case insensitive Now allow unlimited KeepAlive requests HTTP version detection consolidated into HANDLE_REQUEST For HTTP/0.9 requests add " HTTP/0.9" to the request line for logging. Version 2.0A BETA (9/19/97) Added HTTP/1.1 conditional compliance including: Persistent connections (previously supported) Pipelining Chunked Transfer Encoding of CGI input and output Multiple Host configuration (allows one server to appear as many) **New CGILIB version 2.0A to support chunked input and output** Added BreakLog and BackLogs configuration options. Bug fix on REPLACE of LOCAL_HOST when logging results. Log referring page in SERVERLOG for 404 Not Founds. Increased ABSMAXPROC define from 25 to 50. All Arrays are now Global for maximizing CPU performance. Add CGI code to support "Status:" results. HTTP/0.9 support added. (Better late than never..;-) Unnecessary displays have been minimized. Much code has been rewritten and cleaned up. And has been resequenced. Version 1.2P BETA (4/17/97) Bug fix on file timestamp, mins & secs were not being set which interfered with browser refreshes until there was an hour change. Version 1.2N BETA (3/3/97) Don Gregory's multi-host patches added. InputTimeout config option added. Two new results added: "497 KeepAlive Terminated" & "498 Input Timeout". Now count requests in addition to connections. Version 1.2M BETA (2/5/97) Bug fix to correctly handle new connections that go CLOSEREQUESTRECEIVED. New default security entry for the server (*) in WWWSERV/ACCESS/CONFIG. Response headers fixed to conform to RFC 1945. LogReferers config option added. LogAgents config option added. CloseTimeOut config option added. Epilog procedures improved. Many displays removed. SAMPLE CONFIGURATION FILES: ---WWWSERV/CONFIG-------(cut here)-------------------------------------- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % NYSED-A-SERIES WWW Config File % % % % Normally named WWWSERV/CONFIG (This is an ALGOL file!) % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % NYSED-A-SERIES specific configuration options % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% MaxSubFiles 140 %The number of subports to open. This is the %number of simultaneous client connections that %will be supported. This can and should be %greater than the number of MaxClients configured %below. Try starting with twice the value of %MaxClients. This allows clients to connect and wait, %if necessary, for an available request handler. Debug Off %On or Off, On = Request & response headers will %be logged to WWWSERV/DEBUG file. GMTConversion +5 %or -5 etc... EST = +5, EDT = +4, etc...... %The Server will attempt to get this value from the %MCP. This value will be ignored if the MCP was %able to provide it. InputTimeout 30 %The number of seconds that we will allow a client %connection to exist without receiving any input. %The timer is reset each time input arrives from %the client. This option protects the server %from clients that cannot proceed with their %request because of some external problem. %This also determines the wait for additional %requests on persistent connections. CloseTimeOut 30 %Number of seconds that the server waits for a %client connection to close in an orderly manner. BreakLog 999000 %Record count at which we want to close a log %file and start a new one. A log file can not %exceed one million records. Previous log files %will be named .../BACK1, .../BACK2, etc. BackLogs 12 %Number of previous log files that are to be %retained on disk before being overwritten. LogReferers On %On or Off, On = Referring pages will be logged %to WWWSERV/LOGS/REFERERLOG. This is useful to %find out which web search engines link to you. LogAgents Off %On or Off, On = Agent info from client will be %logged to WWWSERV/LOGS/AGENTLOG. Useful if you %want to know what browsers your clients use. DNSResolve=On %On or Off, On = Resolve IP Addresses to Host Names. %Off should be used for small intranets w/out access %to DNS servers. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % NCSA httpd.conf configuration options % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ServerName www.nysed.gov %Your host name for filling in %response headers. Port 80 %Socket Number (normally 80 for WWW) DocumentRoot (HOMEWWW)WWW %First node of document file names %residing in the "root" directory. %i.e.: (usercode)WWW %TimeOut 3600 %TimeOut has been deimplemented. %We now rely solely on InputTimeOut for %"timing out" requests and responses. StartServers 10 %Number of servers (request handlers) %started at initialization. %MaxServers 10 %MaxServers has been deimplemented. %Now use the MaxClients option! MinSpareServers 10 %Minimum # of spare servers (Request %Handlers). New handlers are fired up %immediately as needed to maintain %a pool of spares. MaxSpareServers 25 %Maximum # of spare servers (Request %Handlers). When traffic decreases, %extra handlers will terminate. %The web server does not terminate %handlers immediately because traffic %can fluctuate and it is important to %minimize the number of task initiations %and terminations. MaxClients 70 %Maximum # of servers (Request Handlers). %Or in other words, the maximum number of %clients that get serviced simultaneously. KeepAlive On %On or Off, On = KeepAlive is allowed. %If the client requests it, the %connection will remain open after the %first request is serviced to allow %additional requests. This is called %a persistent connection. It benefits %the server by reducing the overhead %required to establish new connections. %KeepAliveTimeout 20 %KeepAliveTimeout has been deimplemented. %InputTimeout now determines the wait for %additional requests from the client. MaxKeepAliveRequests 0 %Maximum number of requests allowed %for a single connection. Zero allows %unlimited keep alive requests. RefererIgnore http://www.nysed.gov %Don't log referring pages %on this host. Used to filter %logging of referring pages. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % NCSA srm.conf configuration options % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %Alias /REGENTS/ (RGNTS)WWW/ %Fake name for URL followed by %the real usercode and 'root' %directory. Allows access to %files with different usercodes. %Multiple Alias entries are allowed. %Host www.icedp.org (ICEDP)WWW %DocumentRoot for requests %addressed to Host: www.icedp.org %Only reliable for HTTP/1.1 %requests. Some HTTP/1.0 clients %do not support the Host field. %Multiple Host entries are allowed %and can provide flexibility, for %Host 149.10.88.5 (HOMEWWW)WWW %instance add one with the IP Address. %RHost www.nysed.gov http://a-series.nysed.gov:8080 %Redirect Host %allows for host redirection when %moving a web site. DefaultType text/plain %Default mime type. Text/plain %is highly recommended. DirectoryIndex HOME.HTML %Default document name ScriptAlias /IMAGEMAP/ /CGI-IMAGEMAP/ %For Imagemap 'scripts' % First (fake) name you decide % 2nd name is internal to server. ScriptAlias /ROTATOR/ /CGI-ROTATOR/ %For Rotator 'scripts' % First (fake) name you decide % 2nd name is internal to server. ScriptAlias /COMS/ /CGI-COMS/ %ScriptAlias for COMS Gateway % First (fake) name you decide % 2nd name internal to server. %WWWSERV/COMS/CONFIG is required. %RedirectTemp /mydoc.html /demo/datacom.html %temporary redirection %RedirectPerm /doc.html http://www.you.com/home.html %permanent redirection %RP /doc.html http://www.you.com/home.html %permanent redirection ---WWWSERV/MIME/TYPES---(cut here)----------------------------------------- %This is an ALGOL file %MIME type/subtype file extensions %The 'class' extension on the next line allows %JAVA applets to reside on the A-Series application/octet-stream exe class application/pdf pdf application/zip zip application/x-envoy evy audio/x-wav wav image/gif gif image/jpeg jpeg jpg jpe image/tiff tiff tif text/html html htm text/plain txt text/richtext rtx video/mpeg mpeg mpg mpe video/quicktime qt mov video/x-msvideo avi ---WWWSERV/ACCESS/CONFIG--------(cut here)------------------------------ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % NYSED-A-SERIES % % WWWSERV/ACCESS/CONFIG FILE (OPTIONAL) THIS IS AN ALGOL FILE. % % % % MAKE SURE TO PLACE SUB-DIRECTORIES FIRST IF THEIR ACCESS % % RESTRICTIONS DIFFER FROM THEIR PARENT DIRECTORIES. THE FIRST % % MATCH IN SEQUENTIAL ORDER IS WHAT TAKES EFFECT. % % % % THIS FILE MAY CHANGE IN FUTURE TO GET AROUND RECORD SIZE LIMIT. % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %Unrestricted access (default anyway) %under web server usercode order allow,deny allow from all %Restrict access to a single domain % %under web server usercode % % order deny,allow % deny from all % allow from .nysed.gov %limit access to nysed.gov domain % % %Restrict access to aliased files under usercode different from server % %use real part of alias (not fake part) % % order deny,allow %restrict access to two subnets % deny from all % allow from 149.10.160 149.10.192 % % %Restrict access to a particular CGI application % %use real part of scriptalias % %Will limit all methods (GET & POST) % order deny,allow % deny from all % allow from .nysed.gov % % %Require ID and password for a directory % % AuthName Datacom % % order deny,allow % deny from all % satisfy any % require user joe:secret %the ID and the password % % %Require EITHER ID/password OR must access from within a domain % % AuthName Datacom % % order deny,allow % deny from all % allow from .nysed.gov %domain allowed here % satisfy any %any means either/or % require user joe:secret % % %Require BOTH ID/password AND must access from within a domain % % AuthName "Joes Stuff" % % order deny,allow % deny from all % allow from .nysed.gov % satisfy all %all means both required % require user joe:secret % % %Require specific USERCODE and (USERDATA) PASSWORD for a directory % % AuthName Datacom % % order deny,allow % deny from all % satisfy any % require user joeuser: %the USERCODE w/out a password % % %Require *ANY* USERCODE and its (USERDATA) PASSWORD for a directory % % AuthName Datacom % % order deny,allow % deny from all % satisfy any % require user %NO USERCODE = *any* USERCODE % % %Next entry is a NYSED extension. %An "*" indicates the default access control for the whole server. %This entry is only required if you want to default to restricted access. % %THIS IS THE DEFAULT FOR THE SERVER, IT MUST BE LAST!!! % % order deny,allow % deny from all % allow from .nysed.gov %limit access to nysed.gov domain % % ---WWWSERV/COMS/CONFIG--------(cut here)-------------------------------- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % NYSED-A-SERIES % % WWWSERV/COMS/CONFIG FILE THIS IS AN ALGOL FILE. % % % % THE PROGRAM ALIAS WILL FOLLOW THE CGI SCRIPTALIAS AND THAT % % CAN BE FOLLOWED BY ADDITIONAL "PATH INFO". % % FOR EXAMPLE: http://www.nysed.gov/coms/tpnumber1/trancode % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %ALIAS: INPUTAGENDA OF WINDOW,APP TIMEOUT SECONDS,POST DATA TYPE TPNUMBER1: WEBAPPINAG OF WWWTEST,30,TEXT %TPNUMBER2: NONAPPINAG OF NONWINDOW,30,BINARY ECHO: ECHOINAG OF WWWTEST,30,TEXT ---End of WWWSERV/COMS/CONFIG--------(cut here)-------------------------